Page({
  data: {
      list: [],
      active: 0, //top栏样式,
  },

  onLoad() {
      this.getDate()
  },
  async getDate() {
      const res = await wx.$http.get('/driver/tasks/list', {
          page: 1,
          pageSize: 10,
          status: 1
      })
      console.log(res);
      const data =  getApp().itemData
      console.log(data.items);
      this.setData({ list: data.items })
  },
  // 点击详情
  goToPage(e) {
    console.log(e);
    const { list } = this.data
      wx.navigateTo({
          url: '/task-detail/pages/detail/index?id=' + list[0].id
      })
  },
  // 在途跳转详情
  goToRegistration() {
    wx.navigateTo({
      url: '/task-detail/pages/registration/index',
    })
  }
})
